Skip to content

Conversation

@dov
Copy link
Contributor

@dov dov commented Jun 4, 2014

This pull request contains an initial implementation of a binary mathematical morphology (see: http://en.wikipedia.org/wiki/Mathematical_morphology) addon for Pillow. It is used to apply morphological operators on PIL images of mode 'L' where each pixel is considered binary. The library contains support for applying morphological operators on an image and returns a modified image. E.g. to run an erosion operator on an image do:

mop = ImageMorph.MorphOp(op_name='erosion8')
count,imgOut = mop.apply(img)

The library also supports returning matching features as a python list. E.g. the following code returns all corners found in a binary image:

mop = ImageMorph.MorphOp(op_name='corners')
corners = mop.match(image)

Please let me know if you find this suitable for Pillow or if you would rather I keep it in a separate library.

@aclark4life
Copy link
Member

Cool!

@hugovk
Copy link
Member

hugovk commented Jun 5, 2014

Sounds good!

The Travis CI build failed for Python 3.x:
https://travis-ci.org/python-pillow/Pillow/builds/26794214

You may find it useful to enable Travis for your own repo here:
https://travis-ci.org/profile

@aclark4life aclark4life closed this Jun 7, 2014
@aclark4life aclark4life reopened this Jun 7, 2014
@aclark4life
Copy link
Member

Yeah, fix Py 3 and we'll merge this

@aclark4life aclark4life added this to the 2.5.0 milestone Jun 7, 2014
@wiredfool
Copy link
Member

I've done some work on this in my morphology branch (https://github.com/wiredfool/Pillow/tree/morphology) It's working for all Cpython, 2.6->3.4, pypy is not working due to a missing PyByteArray_Size symbol in the C-api layer. I need to check with the pypy people if I'm just missing something there, but it's not going to happen tonight or tomorrow.

@aclark4life
Copy link
Member

@wiredfool Looks like 3.x still fails?

@wiredfool
Copy link
Member

It's this travis: https://travis-ci.org/wiredfool/Pillow/builds/28097706 based on my branch not the one on this thread.

@wiredfool wiredfool mentioned this pull request Jun 23, 2014
@wiredfool
Copy link
Member

See #712

@wiredfool wiredfool closed this Jun 23, 2014
@hugovk hugovk mentioned this pull request Jun 24, 2014
@radarhere radarhere changed the title Initial commit of binary morphology addon. Initial commit of binary morphology addon Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants